﻿package plugin.duanzao
{
    import com.core.*;
    import com.sh.game.consts.*;
    import com.sh.game.global.*;
    import view.*;

    public class DuanZao extends FlashUIBase
    {
        private var _ui:DuanZaoUICtrl;

        public function DuanZao()
        {
            return;
        }// end function

        override protected function preLoaderInit() : void
        {
            appendLoader(Config.getUrl("assets/images/mornui/common.swf", ResourceType.NORMAL));
            appendLoader(Config.getUrl("assets/images/mornui/duanzao.swf", ResourceType.NORMAL));
            return;
        }// end function

        override protected function initGUI() : void
        {
            this._ui = new DuanZaoUICtrl(this.close);
            this._ui.daoju_hechengView.mUIBase = this;
            mGUI = this._ui;
            return;
        }// end function

        override protected function openBefore() : void
        {
            if (data == null)
            {
                (mGUI as DuanZaoUICtrl).openRefresh(1);
                return;
            }
            if (data == 1 || data == 2 || data == 3 || data == 4 || data == 5)
            {
                (mGUI as DuanZaoUICtrl).openRefresh(this.data);
            }
            else if (data.gototype == 3)
            {
                (mGUI as DuanZaoUICtrl).openRefresh(3);
                (mGUI as DuanZaoUICtrl).daoju_hechengView.openRefresh(data);
            }
            else if (data.gototype == 5)
            {
                (mGUI as DuanZaoUICtrl).openRefresh(5);
            }
            return;
        }// end function

        override protected function openRefresh() : void
        {
            return;
        }// end function

        override public function close() : void
        {
            super.close();
            var _loc_1:* = ModelProxy.getValue("data", "qhflag");
            if (_loc_1)
            {
                ModelProxy.change("data", "qhflag", false);
                ModelProxy.change("qianghua", "setvisible", null);
                ModelProxy.change("movetips", "error", "一键强化中断");
                return;
            }
            return;
        }// end function

    }
}
